package cn.qihua.dao;

import java.util.List;

import org.hibernate.SessionFactory;

import cn.qihua.model.BaseProduct;

public interface IBaseProductDAO {

	public static final String ORDER_ID = "orderId";
	public static final String TEXT = "text";
	public static final String SITE_URL = "siteUrl";
	public static final String IP = "ip";
	public static final String TYPE = "type";
	public static final String USER_ID = "userId";
	public static final String USER_NAME = "userName";
	public static final String PROGRESS = "progress";
	public static final String YEARS = "years";
	public static final String IS_DISUSE = "isDisuse";
	public static final String STATUS = "status";
	public static final String REMARK = "remark";

	public abstract void setSessionFactory(SessionFactory sessionFactory);

	public abstract Boolean save(BaseProduct transientInstance);

	public abstract void delete(BaseProduct persistentInstance);

	public abstract BaseProduct findById(java.lang.Integer id);

	public abstract List findByExample(BaseProduct instance);

	public abstract List findByProperty(String propertyName, Object value);

	public abstract List findByOrderId(Object orderId);

	public abstract List findByText(Object text);

	public abstract List findBySiteUrl(Object siteUrl);

	public abstract List findByIp(Object ip);

	public abstract List findByType(Object type);

	public abstract List findByUserId(Object userId);

	public abstract List findByUserName(Object userName);

	public abstract List findByProgress(Object progress);

	public abstract List findByYears(Object years);

	public abstract List findByIsDisuse(Object isDisuse);

	public abstract List findByStatus(Object status);

	public abstract List findByRemark(Object remark);

	public abstract List findAll();

	public abstract BaseProduct merge(BaseProduct detachedInstance);

	public abstract void attachDirty(BaseProduct instance);

	public abstract void attachClean(BaseProduct instance);

	public abstract Boolean update(BaseProduct transientInstance);

	public abstract List findAll(int start, int limit);

	public abstract List findByNow(int after, int start, int limit);

	public abstract List findByProperty(String propertyName, Object value,
			int start, int limit);

	public abstract Integer getTotalBySearch(String propertyName, String value);

	public abstract List searchByProperty(String propertyName, String value);

	public abstract List searchByProperty(String propertyName, String value,
			int start, int limit);

	public abstract Integer getTotal();

	public abstract Integer getTotalByWhere(String where);

	public abstract Integer getTotalByProperty(String propertyName, Object value);

	public abstract boolean changeStatus(int id, Boolean value);

	public abstract boolean changePropertyById(int id, String field,
			Object value);

	public abstract boolean changeProgress(int id, String value);

	public abstract boolean changeYears(int id, int value);

	public abstract List findByStatus(Object status, int start, int limit);

}